AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 2 |
r3wp | 42 |
total: | 44 |
results window for this page: [start: 1 end: 44]
world-name: r4wp
Group: Rebol School ... REBOL School [web-public] | ||
BrianH: 5-Oct-2012 | You can build that singleton when rfunc is called initially, or if you only need one then you can use funct/with to make a static local var with that value. (Still haven't analyzed the source.) | |
Group: !REBOL3 ... General discussion about REBOL 3 [web-public] | ||
Marco: 16-Mar-2013 | another contribution: use [count inc start end op][ count: inc: start: end: op: 0 in-range: func [ [catch] 'word [word!] start [number!] end [number!] /bump step [number!] /local result ] [ if inc = 0 [ if step = 0 [throw make error! "step parameter cannot be = 0"] count: start either start > end [inc: -1 op: :greater-or-equal?][inc: 1 op: :lesser-or-equal?] unless none? step [inc: step] ] set word count result: either op count end [count: (get word) + inc true][false] if not result [count: inc: start: end: op: 0] result ] ] i: 0 ; define a var while [in-range i 1 3] [print i] |
world-name: r3wp
Group: All ... except covered in other channels [web-public] | ||
BrianH: 4-May-2006 | Here's my first attempt at a pattern for recursion-safe temporaries: use [var ...] [rule ...] ==> (tmp1: use [var ...] copy/deep [[rule ...]]) tmp1 It would only work with a directly specified variable and rule block, and you should only use the temporaries directly in the rule block or they won't get rebound. Now, using REBOL 3's closure (probably better): use [var ...] [rule ...] ==> (tmp1: do closure [/local var ...] [[rule ...]]) tmp1 Of course this is just an example. An actual rewrite engine would premake the closure and insert it directly instead of making it in the rule and doing it. REBOL's existing function recursion support wouldn't work because the function returns before the rule is run. I would prefer a native implementation of this operation if possible. | |
Group: RAMBO ... The REBOL bug and enhancement database [web-public] | ||
Ladislav: 26-Jan-2007 | I show you something from my article: a: b: charset [#"a" #"b"] c: insert charset [#"a"] #"b identical?: func [ {are the values identical?} a [any-type!] b [any-type!] /local var var2 ] [ ; compare types if not-equal? type? get/any 'a type? get/any 'b [return false] ; there is only one #[unset!] value unless value? 'a [return true] ; errors can be disarmed and compared afterwards if error? :a [a: disarm :a b: disarm :b] ; we need to be transitive for decimals and money if any [decimal? :a money? :a] [ return found? all [same? a b zero? a - b] ] ; we need to be transitive for dates if date? :a [return found? all [same? a b same? a/time b/time]] ; we need to be able to compare even the closed ports if port? :a [return equal? reduce [a] reduce [b]] ; our function has to work for structs if struct? :a [return same? third a third b] ; we can have something stronger than SAME? for bitsets if bitset? :a [ unless same? a b [return false] if 0 = length? a [return true] unless equal? var: find a 0 find b 0 [return false] either var [ remove/part a 0 var2: find b 0 insert a 0 ] [ insert a 0 var2: find b 0 remove/part a 0 ] return var <> var2 ] same? :a :b ] identical? a b ; == true identical? a c ; == false | |
Group: Core ... Discuss core issues [web-public] | ||
JaimeVargas: 12-Apr-2005 | ;; nexted-foreach a simple way of generating nexted foreach loops compose-foreach: func [var data code][reduce ['foreach var data code]] nexted-foreach: func [vars blocks code /local var][ if empty? blocks [return code] compose-foreach first vars first blocks nexted-foreach next vars next blocks code ] | |
Graham: 10-Feb-2007 | eg; func [face /local var][print face/text] how do I get to the [print face/text ] part? | |
Ladislav: 10-Feb-2007 | second func [face /local var] [print face/text] ; == [print face/text] | |
james_nak: 14-Sep-2007 | How do you clear out a local variable within a function? I have this scenario and I can't get the function to run more than once. I could copy the contents to a temp var but that seems silly. a: func [ some-var /local s] [ s: "example %text% string" replace/all s "%text%" some-var ] Once I run this thing "s" never gets its orginal value. Thanks | |
Anton: 15-Nov-2007 | Pekr, I think it depends how many local vars are used in the function. With one local var, I got 14263 recursions before stack overflow. Maybe he can optimize by moving some variables out into a shared context. | |
Anton: 12-Apr-2008 | It's the same method; all of the words (including the /local refinement) in the following function spec are local to the function's context: func [arg /local var] | |
Steeve: 30-Mar-2009 | In fact i use ALSO in functions to save the use of temporay variables. Instead of doing that: func [.. /local result][ .... result: ... ;*** compute result ... do something before returning the result :result ;** return the result ] I do: func [.. /local result][ .... also (compute the result) .(do something before returning the result) ] It saves the declaration of the result local var | |
Geomol: 31-Mar-2009 | Using ALSO returns some data. If your code look like this: mp3-data: load-mp3-function and that load-mp3-function ends with an ALSO, setting the local var to none, you still have a full copy in mp3-data. Actually you end up having 2 copies for some time, until the garbage collector frees the local version. Later in your code, you need to set mp3-data to none to free to memory (which the garbage collector does). Now, is this how you use ALSO and why you need it? | |
Geomol: 31-Mar-2009 | Where I see a potential problem with ALSO, is if you in a function load a local var with a huge amount of data, say 1GB. And then to release that data ends your function with: also copy local-data local-data: none At that moment between the two arguments to ALSO, you have 2 GB of data allocated. The first 1 GB is freed, when the garbage collector comes to it. | |
Steeve: 31-Mar-2009 | If the contents var is not unset and then the load-mp3 function is not anymre called. Then, the garbage collector can't free the serie because it stays handled by the local var contents. | |
Steeve: 27-May-2009 | I know, i saw many implementations wich use recursive calls of parse (to deal with local var) in the past. But i don't like that. I saw it's slower most of the time than using recursive rules (well, it's the purpose of parse) | |
Anton: 16-Aug-2010 | svv/vid-styles/button/multi/block: func [face blk][ ; <- This only does BUTTON for now. if pick blk 1 [ ;face/action: func [face value] pick blk 1 face/action: func [face value /local window word] compose/only [ window: face/parent-face ; Find the window face <-- (simplistic for now) word: window/pane/1/var ; Find a word which references a field in the window. <-- (simplistic for now) print "Remake action function." face/action: func [face value] probe append append copy [bind-funcs] to-lit-word word (pick blk 1) do-face face value ] if pick blk 2 [face/alt-action: func [face value] pick blk 2] ; <- Also need to remake alt-action similarly to action, above. ] ] bind-funcs: func [word] [ foreach window-function [hello][bind second get window-function word] ] hello: does [f/text: copy "hello" show f] open-window: does [ view/new center-face layout ctx: vid-context [ f: field button "Hello" [hello] button "Clear" [clear-face f] ] ] open-window open-window do-events | |
Anton: 16-Aug-2010 | svv/vid-styles/button/multi/block: func [face blk][ ; <- This only does BUTTON for now. if pick blk 1 [ ;face/action: func [face value] pick blk 1 face/action: func [face value /local window word] compose/only [ window: face/parent-face ; Find the window face <-- (simplistic for now) word: window/pane/1/var ; Find a word which references a field in the window. <-- (simplistic for now) print "Remake action function." face/action: func [face value] probe append append copy [bind-funcs] to-lit-word word (pick blk 1) do-face face value ] if pick blk 2 [face/alt-action: func [face value] pick blk 2] ; <- Also need to remake alt-action similarly to action, above. ] ] bind-funcs: func [word] [ foreach window-function [hello][bind second get window-function word] ] hello: does [f/text: copy "hello" show f] open-window: has [window ctx] [ window: view/new center-face layout vid-context/to [ f: field button "Hello" [hello] button "Clear" [clear-face f] button "Clear window2's field" [clear-face window2/user-data/f] ] 'ctx window/user-data: ctx window ] window1: open-window window2: open-window do-events | |
Group: View ... discuss view related issues [web-public] | ||
shadwolf: 8-May-2005 | yes but why I have 800 Ko used for a ingle function with a local var called twice | |
Gabriele: 25-Aug-2005 | my-access: make ctx-access/panel [ set-face*: func [face value /local val][ if all [block? face/pane block? value][ either set-word? value/1 [ foreach [word val] value [ set-find-var face/pane to word! word val ] ] [ foreach f face/pane [ if any [find f/flags 'input find f/flags 'panel] [ if not empty? value [ set-face f value/1 value: next value ] ] ] ] ] ] ] | |
Geomol: 5-Nov-2008 | Henrik, the hsv2rgb function, I made for Canvas RPaint. It takes H S V values as decimals in the area 0.0 - 1.0 as input: hsv2rgb: func [ H S V /local RGB var_h var_i var_1 var_2 var_3 var_r var_g var_b ][ RGB: 0.0.0 either S = 0 ;HSV values: 0 Ö 1 [ RGB/1: to-integer V * 255 RGB/2: to-integer V * 255 RGB/3: to-integer V * 255 ][ var_h: H * 6 if var_h >= 6 [var_h: 0] ;H must be < 1 var_i: to-integer var_h var_1: V * (1 - S) var_2: V * (1 - (S * (var_h - var_i))) var_3: V * (1 - (S * (1 - (var_h - var_i)))) switch var_i [ 0 [var_r: V var_g: var_3 var_b: var_1] 1 [var_r: var_2 var_g: V var_b: var_1] 2 [var_r: var_1 var_g: V var_b: var_3] 3 [var_r: var_1 var_g: var_2 var_b: V ] 4 [var_r: var_3 var_g: var_1 var_b: V ] 5 [var_r: V var_g: var_1 var_b: var_2] ] RGB/1: to-integer var_r * 255 ;RGB results: 0 Ö 255 RGB/2: to-integer var_g * 255 RGB/3: to-integer var_b * 255 ] RGB ] | |
Group: Parse ... Discussion of PARSE dialect [web-public] | ||
Micha: 5-Sep-2010 | how to set local vars in parse ? rule: [ "text" (var: "local") ] var: "global" f: func [ /local var ] [parse "test" rule return var ] f ; result = none not "local" what to do get result = "local" | |
Nicolas: 5-Sep-2010 | ;Does this help? rule: [ "text" (var: "local") ] var: "global" f: func [ /local var ] [var: "local" parse "test" rule return var ] f | |
Graham: 5-Sep-2010 | f: has [ var rule ][ var: none rule: [ "text" end (var: copy "local" ) ] parse/all [ "text" ] rule var ] | |
Nicolas: 5-Sep-2010 | ;This also works var: "global" f: has [var] [ rule: [ "test" (var: "local") ] parse "test" rule var ] f | |
Anton: 5-Sep-2010 | rule: [ "text" (var: "local") ] var: "global" f: func [ /local var ] [var: "funclocal" parse "text" rule return var ] f ;== "funclocal" var ;== "local" | |
Ladislav: 5-Sep-2010 | It is quite hard to decipher what actually Micha meant, I suppose, he wanted this? rule: ["text" (var: "local")] var: "global" f: func [/local var] [parse "text" bind rule 'var return var] | |
Group: CGI ... web server issues [web-public] | ||
Volker: 21-Aug-2006 | size-text: xwindows is client/server. the x-server , that is your local computer, which offers to aplications to display things to you. And it has some important informations locally, especially the fonts (and can cache images and such). /view needs access to the fonts and so access to a running x-server. the x-libs are only an interface to connect to the server. (The xserver-libs could be used directly, but well, /view does not do that. Seems to be tricky.) A incomplete sketch how to do it, with no attention to security: So with /view you need a running x-server, one way to do that headless is vnc. Can also run on another machine. Then you need to tell rebol where it is, there is an env-var $DISPLAY. Which must be set before rebol runs. Did not figure out how to configure that. Running a bash-script as cgi, set $DISPLAY, call the real rebol-script should work. And there may be issues with authentification, x-windows does not like everyone to connect by default, or the other way around, its too easy to make it too open ("xhost + ip"). There are more secure ways, but looked more complicated and i never tried. All in all i would run such things on windows. | |
Group: SDK ... [web-public] | ||
Rondon: 14-Jan-2012 | REBOL [ Title: "ARCFOUR and CipherSaber" Date: 17-Jan-2004 File: %arcfour.r Author: "Cal Dixon" Purpose: {Provides encryption and decryption using the ARCFOUR algorithm} Note: {this implementation can decrypt data at about 40KB/s on my 1Ghz AMD Duron system with Rebol/View 1.2.10.3.1} Library: [ level: 'advanced platform: 'all type: [function module protocol] domain: [encryption scheme] tested-under: [view 1.2.10.3.1 on [W2K] by "Cal"] license: 'PD support: none ] ] ;ARCFOUR specification: http://www.mozilla.org/projects/security/pki/nss/draft-kaukonen-cipher-arcfour-03.txt ;CipherSabre specification: http://ciphersaber.gurus.com/faq.html#getrc4 arcfour-short: func [key [string! binary!] stream [binary! string!] /mix n /local state i j output swap addmod sz][ swap: func [a b s /local][ local: sz s a poke s a + 1 to-char sz s b poke s b + 1 to-char local ] addmod: func [ a b ][ a + b // 256 ] sz: func [ s a ][ pick s a + 1 ] state: make binary! 256 repeat var 256 [ insert tail state to-char var - 1 ] j: 0 loop any [ n 1 ] [ i: 0 loop 256 [ swap i j: addmod j add sz state i sz key i // length? key state i: i + 1] ] i: j: 0 output: make binary! length? stream repeat byte stream [ swap i: addmod i 1 j: addmod j sz state i state insert tail output to-char xor~ byte to-char sz state addmod (sz state i) (sz state j) ] clear state return output ] make root-protocol [ addmod: addmod: func [ a b ][ a + b // 256 ] sz: func [ s a ][ pick s a + 1 ] swap: func [a b s /local][ local: sz s a poke s a + 1 to-char sz s b poke s b + 1 to-char local ] ins: get in system/words 'insert i: 0 j: 0 open: func [port][ port/state/tail: 2000 port/state/index: 0 port/state/flags: port/state/flags or port-flags port/locals: context [ inbuffer: make binary! 40000 state: make binary! 256] use [key n i j] [ key: port/key n: port/strength repeat var 256 [ ins tail port/locals/state to-char var - 1 ] j: 0 loop any [ n 1 ] [ i: 0 loop 256 [ swap i j: addmod j add sz port/locals/state i sz key i // length? key port/locals/state i: i + 1 ] ] ] i: j: 0 ] insert: func [port data][ system/words/insert tail port/locals/inbuffer data do [] ] copy: func [port /local output][ output: make binary! local: length? port/locals/inbuffer loop local [ swap i: addmod i 1 j: addmod j sz port/locals/state i port/locals/state ins tail output to-char sz port/locals/state addmod (sz port/locals/state i) (sz port/locals/state j) ] local: xor~ output port/locals/inbuffer clear port/locals/inbuffer local ] close: func [port][ clear port/locals/inbuffer clear port/locals/state clear port/url clear port/key] port-flags: system/standard/port-flags/pass-thru net-utils/net-install arcfour self 0 ] arcfour: func [key stream /mix n /local port][ port: open compose [scheme: 'arcfour key: (key) strength: (n)] insert port stream local: copy port close port return local ] ; CipherSaber is an ARCFOUR stream prepended with 10 bytes of random key data ciphersaber: func [ key stream /v2 n ][ arcfour/mix join key copy/part stream 10 skip stream 10 either v2 [ any [ n 42 ] ][ 1 ] ] | |
Group: !RebGUI ... A lightweight alternative to VID [web-public] | ||
shadwolf: 29-Mar-2005 | G4C TUT_MCListview // =========================================================== // A Multi Column (or Database) Listview.. // =========================================================== WINDOW 126 90 367 373 "Listview" winattr style resize xOnLoad // add some records to the listview & open.. gosub #this AddRecords guiopen #this xOnClose guiquit #this // =========================================================== // The listview // - This is a normal MULTISELECT listview (the default). // For this type to be triggered, you must double-click it. // =========================================================== XLISTVIEW 0 0 0 0 'The Title' "" var attr ID mylv attr resize 0022 attr frame sunk // Give it a grid and allow the user to drag, drop & re-arrange // the lines - You can add more styles here.. attr style grid/arrange/drag/drop/arrange // Add some columns. The first one we state with a '#' // in front to indicate we mean the 1st column. attr LVCOLUMN '#Item/width/120/TITLE/Description' attr LVCOLUMN 'Units/width/60/TITLE/Units/TYPE/number/JUSTIFY/RIGHT' attr LVCOLUMN 'Amount/width/60/TITLE/Amount/TYPE/number/JUSTIFY/RIGHT' attr LVCOLUMN 'Total/width/60/TITLE/Total/TYPE/number/JUSTIFY/RIGHT' // show the line double clicked.. SetWinTitle #this 'SUM: $%Units x $%Amount = $($%Units * $%Amount)' // =========================================================== // This is a routine to add 100 records with various // meaningless values to the above listview. Note how // the fields can be used as normal variables. // =========================================================== xRoutine AddRecords local c use lv #this mylv // before we start, we HIDE the listview. This will // stop Gui4Cli from visually refreshing it every time // we add a record and will GREATLY increase the speed. // This will have no effect if the window is closed. // After we finish, we show it again.. setevent #this mylv HIDE for c 0 100 // add an empty record.. lv add '' // Fill the fields with various values.. %Item = "This is Item $c" %Units = $($c * 3) %Amount = $(($%Units / 2)*1000) %Total = $($%Units * $%Amount) endfor // Show the listview again, refreshing the display.. setevent #this mylv SHOW // =========================================================== // Right mouse button handling - Some menu choices.. // =========================================================== xOnRMB QuickMenu -1 -1 'Select All/Remove selected/Add 100 records/#sepa/cancel' use lv #this mylv docase $$choice case = 0 // Select All lv select all break case = 1 // Remove selected lv delete selected break case = 2 // Add some records.. gosub #this AddRecords endcase | |
Ashley: 6-Dec-2005 | How's this for focus / unfocus trigger logic? 1. Add two user-definable action handlers to ctx-rebgui app-focus-action: func [face] [true] app-unfocus-action: func [face] [true] 2.Modify the ctx-rebgui/edit focus and unfocus functions: unfocus: has [face][ if face: view*/focal-face [ unless face/unfocus-action face [return false] ] ... focus: func [ "Focuses key events on a specific face." face [object!] ][ unless unfocus [return] if face/show? [ unless face/focus-action face [return false] ... 3. Extend the standard rebface definition 4. Add the following to the layout function: focus-action: either attribute-focus-action [make function! [face /local var] attribute-focus-action] [:app-focus-action] unfocus-action: either attribute-unfocus-action [make function! [face /local var] attribute-unfocus-action] [:app-unfocus-action] which would then let us write code like: ctx-rebgui/app-focus-action: func [face] [face/text: form random 1000] display "" [ field field focus [face/text: form now/time/precise] field ] The logic is simple: "Execute the default focus / unfocus functions (which in turn default to true) *unless* a focus / unfocus function has been provided for the face. When a focus / unfocus event is called execute the assigned handler function *first* and only proceed if it returns true." Does this meet the design requirement? | |
Gabriele: 15-Mar-2006 | ; default one is very stupid my-access: make ctx-access/panel [ set-face*: func [face value /local val][ if all [block? face/pane block? value][ either set-word? value/1 [ foreach [word val] value [ set-find-var face/pane to word! word val ] ] [ foreach f face/pane [ if any [find f/flags 'input find f/flags 'panel] [ if not empty? value [ set-face f value/1 value: next value ] ] ] ] ] ] ] | |
Group: Rebol School ... Rebol School [web-public] | ||
Steeve: 3-Jan-2009 | map: func [ [throw] "Evaluates a block for each value(s) in a series and returns them as a block." 'word [word! block!] "Word or block of words to set each time (local)" data [block!] "The series to traverse" body [block!] "Block to evaluate each time" /into "Collect into a given series, rather than a new block" output [series!] "The series to output to" ] [ unless into [output: make block! either word? word [length? data] [divide length? data length? word]] head foreach :word data compose [output: (:insert) output (to paren! body)] ] >> map x [1 2 3 4][x + x] == [2 4 6 8] >> map [x y][1 2 3 4][x + y] == [3 7] >> map/into [x y][1 2 3 4][x + y][10 11 12] == [3 7 10 11 12] But still a problem with the output var collision | |
Group: rebcode ... Rebcode discussion [web-public] | ||
BrianH: 12-Oct-2005 | Well finding an example is simple: Just convert to stack code and figure out when the stack would be used more than one deep between ops. That means more than one temp var. What we get for going to a register machine in a stack language :) This would all be solved by a built-in USE directive with literal blocks that acts like USE in REBOL except only binding at rebcode creation time. It could be implemented as a built-in rewrite rule, changing the temporary variables to local variables, renaming if necessary. This rewrite would be done after the user-defined rewrites were done, but before the binding to the opcodes. Let me think about how this could be implemented - I am late for a class. | |
Group: !REBOL3-OLD1 ... [web-public] | ||
Joe: 29-May-2008 | inside the function you do bind/copy blk 'local-var | |
Joe: 29-May-2008 | local-var is defined but the other ones, tag-title, tag-x, tag-y ... I don't want to have to define in /local local-var ... | |
Steeve: 2-Sep-2009 | This is a dirty hack of the LAYOUT function: you're warned if a set-word in the layout is not local. use [x src][ src: third find second :layout 'while src: first find src/forever block! insert back tail insert src [if same? in system/words x:][x [print ["Warning:" x "is global var"]]] ] | |
Group: !Cheyenne ... Discussions about the Cheyenne Web Server [web-public] | ||
Will: 21-May-2008 | impressed! 8) I finally gave another try at php support in cheyenne and after patching fastcgi.c as suggested it now works like a charm. If you are on os x and use macports, here is a way to patch and compile: sudo port install php5 +mysql5 +fastcgi sudo port uninstall php5 cd /opt/local/var/macports/distfiles/php5/ sudo tar -xjf php-5.2.6.tar.bz2 >> run patch below tar -cjf php-5.2.6.tar.bz2 php-5.2.6 sudo port install php5 +mysql5 +fastcgi checksum.skip=yes copy of Dockimbel's patch with path fixed for this example ;---- cut'n paste the following code in REBOL's console ---- patch-php: has [buffer pos][ target: %php-5.2.6/sapi/cgi/fastcgi.c if none? attempt [buffer: read target][ print "unable to find the file to patch!!" exit ] either parse buffer [ thru "int fcgi_accept_request(" to "if (req->fd >= 0) {" pos: to end ][ insert pos "^/^-^-^-^-break;^/^-^-^-^-" write target buffer print "patch applied." ][ print "failed to locate the line to patch!!" ] ] patch-php ;---- end of code ---- | |
Dockimbel: 9-May-2011 | This is both against the structure of Unix and modern Windows systems. UNIX filesystem layout usage are not identical. Here are the Apache error log location in just 3 UNIX flavours (among dozens): * RHEL / Red Hat / CentOS / Fedora Linux Apache error file location - /var/log/httpd/error_log * Debian / Ubuntu Linux Apache error log file location - /var/log/apache2/error.log * FreeBSD Apache error log file location - /var/log/httpd-error.log and here are the possible locations of configuration file: * /usr/local/etc/apache22/httpd.conf * /etc/apache2/apache2.conf * /etc/httpd/conf/httpd.conf Notice how the file name changes too (both for the log and conf files). BTW, I personnally prefer the GoboLinux approach ;-). One the Windows front, it is barely better. The registry database is fine for storing parameters (name/value couples), but not a REBOL dialect file. A common way is to store files created at runtime in %USER%/AppData/Local/<appname>/. Cheyenne stores all his files (including config file) either in the local folder or in %ALL_USERS%/Cheyenne/. Storing them in %USER% hierarchy should be better. Taking into account every OS specificities (or oddities) is not always a good choice for a cross-platform product. I know that Cheyenne needs to be gentle with the OS best practices, so I am willing to improve it whenever it is possible, but without sacrificing the default behaviour (because that is the way I want it to work for me). BTW, I am also willing to test the centralized logging approach, but it has to be a cross-platform solution. So an abstraction layer needs to be built with connectors for UNIX syslog daemon and Windows Event Logger (they are two types to support: pre-Vista system and new Vista/7 one). Has anyone already worked on such wrappers with REBOL? I personnaly need that the log files be exactly in the same format and if possible at the same place across platforms to make my life easier, so this will keep being the default anyway. The current -f internal Cheyenne command line (Windows specific currently) could be extended to work on UNIX too (and no Max, this one cannot go into the config file, because it indicates where the config file is located ;-)). | |
Group: !REBOL2 Releases ... Discuss 2.x releases [web-public] | ||
Steeve: 31-Dec-2009 | only set-word are used as markers to declare a var as local | |
Group: !REBOL3 ... [web-public] | ||
Geomol: 19-May-2011 | I found an bad effect of not binding words in blocks at all, before the block is evaluated. Functions like LOOP take 2 args, count and block. By not binding the block content before it's evaluated, the count arg local to LOOP is found, if a count var is used in the block. So I guess the REBOL early bind of words is better. | |
Geomol: 26-May-2011 | Maybe a function, where the local var is set, if some condition is fulfilled, and then the local is returned in the end, being NONE, if it wan't set. Is that an example of such a problem function? | |
Group: Core ... Discuss core issues [web-public] | ||
Ashley: 11-Apr-2011 | OK, this is freaky: >> system/version == 2.7.8.2.5 >> a: list-env == [ "TERM_PROGRAM" "Apple_Terminal" "TERM" "xterm-color" "SHELL" "/bin/bash" "TMPDIR" "/var/folders/6O/6OnXy9XG... >> help a A is a block of value: [ "TERM_PROGRAM" "Apple_Terminal" "TERM" "xterm-color" "SHELL" "/bin/bash" "TMPDIR" "/var/folders/6O/6OnXy9XGEjiDp3wDqfCJo++++TI/-Tmp-/" "Apple_PubSub_Socket_Render" "/tmp/launch-BrITkG/Render" "TERM_PROGRAM_VERSION" "273.1" "USER" "Ash" "COMMAND_MODE" "legacy" "SSH_AUTH_SOCK" "/tmp/launch-HlnoPI/Listeners" "__CF_USER_TEXT_ENCODING" "0x1F5:0:0" "PATH" {/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin} "PWD" "/Users/Ash" "LANG" "en_AU.UTF-8" "SHLVL" "1" "HOME" "/Users/Ash" "LOGNAME" "Ash" "DISPLAY" "/tmp/launch-U0Gaqw/org.x:0" "_" "/Users/Ash/REBOL/rebol" ] >> length? a == 18 >> select a "USER" == "Ash" >> select a "HOME" == none | |
Geomol: 1-May-2011 | It's for the parse function, I'm working on, and I want to be sure, I don't get a local var, if vars are used in the parse rules. | |
Group: Red ... Red language group [web-public] | ||
Endo: 20-Feb-2012 | I think this is the correct behaviour, more compatible with REBOL as well. I'm not sure about giving a warning if a local var. clashes with a global one (just for enums may be?) |